#!/bin/bash
RED_COLOR='\E[41m'
BLUE_COLOR='\E[44m'
RESET='\E[0m'
echo -e "${BLUE_COLOR}=== env check ===${RESET}"
if [ ! -e bochsrc ];then
    echo -e "${RED_COLOR}=== no bochsrc ===${RESET}"
    exit 1
fi

if [ ! -e /usr/local/bin/bochs ];then
    echo "${RED_COLOR}=== no bochs ===${RESET}"
    exit 1
fi

if [ ! -e /usr/local/bin/bximage ];then
    echo "${RED_COLOR}=== no bximage ===${RESET}"
    exit 1
fi

if [ -e kernel.img ]; then
    rm kernel.img
fi

echo -e "1\nfd\n\nkernel.img\n" | bximage
